package com.ggs.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class ResultVO <T> {
    private Integer code;
    private String message;
    private T data;

    //   成功提示
    public static  ResultVO success(){
        return new ResultVO(0, "操作成功",null);
    }

    //   成功提示
    public static <T> ResultVO<T> success(T data){
        return new ResultVO<>(0, "操作成功", data);
    }

    //   错误提示
    public static ResultVO error(String message){
        return new ResultVO(1,message,null);
    }
}
